<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", Georgia, Serif;
        }

        html,
        body {
            display: grid;
            height: 100%;
            /* 容器中心对齐 */
            place-items: center;
            text-align: center;
            background: #f2f2f2;
        }

        .slider {
            max-width: 1150px;
            display: flex;
        }

        .slider .card {
            flex: 1;
            margin: 0 10px;
            background: #fff;
        }

        .slider .card .img {
            height: 200px;
            width: 100%;
        }

        .slider .card .img img {
            height: 100%;
            width: 100%;
            /* 图片剪切 适应容器 保留比例 */
            object-fit: cover;
        }

        .slider .card .content {
            padding: 10px 20px;
        }

        .slider .card .content .title {
            font-size: 25px;
            font-weight: 600;
        }

        .slider .card .content .sub-title {
            font-size: 20px;
            font-weight: 600;
            color: #e74c3c;
            line-height: 20px;
        }

        .slider .card .content p {
            text-align: justify;
            margin: 10px 0;
        }

        .slider .card .content .btn {
            display: block;
            text-align: left;
            margin: 10px 0;
        }

        .card .content .btn button {
            background: #e74c3c;
            color: #fff;
            border: none;
            outline: none;
            font-size: 17px;
            padding: 5px 8px;
            border-radius: 5px;
            cursor: pointer;
            transition: .2s;
        }

        .card .content .btn button:hover {
            transform: scale(0.9);
        }
    </style>
</head>

<body>
    <div class="slider owl-carousel">
        <div class="card">
            <div class="img"><img src="../images/2.jpg" alt=""></div>
            <div class="content">
                <div class="title">西部牛仔</div>
                <div class="sub-title">狂野而又不失礼节</div>
                <p>From dawn to the day, dare not how hard it is, I never retreat.
                    Collect memories between two people alone, Even when I cry at this time,
                    Why everything become so, unable to return to the past.</p>
                <div class="btn">
                    <button>Read more</button>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="img"><img src="../images/3.jpg" alt=""></div>
            <div class="content">
                <div class="title">源计划风</div>
                <div class="sub-title">金属迸发出的火花</div>
                <p>From dawn to the day, dare not how hard it is, I never retreat.
                    Collect memories between two people alone, Even when I cry at this time,
                    Why everything become so, unable to return to the past.</p>
                <div class="btn">
                    <button>Read more</button>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="img"><img src="../images/4.jpg" alt=""></div>
            <div class="content">
                <div class="title">腥红之月</div>
                <div class="sub-title">绚烂于绽放中凋零</div>
                <p>From dawn to the day, dare not how hard it is, I never retreat.
                    Collect memories between two people alone, Even when I cry at this time,
                    Why everything become so, unable to return to the past.</p>
                <div class="btn">
                    <button>Read more</button>
                </div>
            </div>
        </div>
    </div>
</body>

<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">

<script>
    $(".slider").owlCarousel({
        loop: true,
        autoplay: true,
        autoplayTimeout: 2000, //2000ms = 2s
        autoplayHoverPause: true,
    })
</script>

</html>